package com.zjut.an.ad.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.ad.dao.AnAd;
import com.zjut.an.ad.dao.AnAdDAO;
import com.zjut.an.util.module.PageModule;


public class AnAdManager {

	@Resource(name = "AnAdDAO")
	private AnAdDAO dao;
	
	public void addData(AnAd obj) {	
		dao.save(obj);
	}
	
	public void updateData(AnAd obj) {
		dao.update(obj);
	}
	
	public void deleteData(AnAd obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<AnAd> objllegeList) {
		for (AnAd AnAd : objllegeList) {
			dao.delete(AnAd);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order,AnAd obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}
	
	public List getDatasByApNo(int apNo) {
		return dao.findByApNo(apNo);
	}

	public AnAd getData(int objId) {
		return dao.findById(objId);
	}
}
